// To parse this JSON data, do
//
//     final galleryHomeModel = galleryHomeModelFromJson(jsonString);

import 'dart:convert';

GalleryHomeModel galleryHomeModelFromJson(String str) => GalleryHomeModel.fromJson(json.decode(str));

String galleryHomeModelToJson(GalleryHomeModel data) => json.encode(data.toJson());

class GalleryHomeModel {
  List<SizeList>? sizeList;
  List<StyleList>? styleList;
  int? needIntegral;
  int? integral;

  GalleryHomeModel({
    this.sizeList,
    this.styleList,
    this.needIntegral,
    this.integral,
  });

  factory GalleryHomeModel.fromJson(Map<String, dynamic> json) => GalleryHomeModel(
    sizeList: json["sizeList"] == null ? [] : List<SizeList>.from(json["sizeList"]!.map((x) => SizeList.fromJson(x))),
    styleList: json["styleList"] == null ? [] : List<StyleList>.from(json["styleList"]!.map((x) => StyleList.fromJson(x))),
    needIntegral: json["needIntegral"],
    integral: json["integral"],
  );

  Map<String, dynamic> toJson() => {
    "sizeList": sizeList == null ? [] : List<dynamic>.from(sizeList!.map((x) => x.toJson())),
    "styleList": styleList == null ? [] : List<dynamic>.from(styleList!.map((x) => x.toJson())),
    "needIntegral": needIntegral,
    "integral": integral,
  };
}

class SizeList {
  int? id;
  String? name;
  String? title;
  String? cover;
  String? size;

  SizeList({
    this.id,
    this.name,
    this.title,
    this.cover,
    this.size,
  });

  factory SizeList.fromJson(Map<String, dynamic> json) => SizeList(
    id: json["id"],
    name: json["name"],
    title: json["title"],
    cover: json["cover"],
    size: json["size"],
  );

  Map<String, dynamic> toJson() => {
    "id": id,
    "name": name,
    "title": title,
    "cover": cover,
    "size": size,
  };
}

class StyleList {
  String? name;
  List<Style>? styles;

  StyleList({
    this.name,
    this.styles,
  });

  factory StyleList.fromJson(Map<String, dynamic> json) => StyleList(
    name: json["name"],
    styles: json["styles"] == null ? [] : List<Style>.from(json["styles"]!.map((x) => Style.fromJson(x))),
  );

  Map<String, dynamic> toJson() => {
    "name": name,
    "styles": styles == null ? [] : List<dynamic>.from(styles!.map((x) => x.toJson())),
  };
}

class Style {
  int? id;
  String? name;
  String? cover;
  String? remark;

  Style({
    this.id,
    this.name,
    this.cover,
    this.remark,
  });

  factory Style.fromJson(Map<String, dynamic> json) => Style(
    id: json["id"],
    name: json["name"],
    cover: json["cover"],
    remark: json["remark"],
  );

  Map<String, dynamic> toJson() => {
    "id": id,
    "name": name,
    "cover": cover,
    "remark": remark,
  };
}

GalleryCreateModel galleryCreateModelFromJson(String str) => GalleryCreateModel.fromJson(json.decode(str));

String galleryCreateModelToJson(GalleryCreateModel data) => json.encode(data.toJson());

class GalleryCreateModel {
  int? id;
  String? title;
  String? content;
  String? url; //图片地址
  String? taskId; //任务id
  int? progress; //进度(0-5)
  int? taskStatus; //任务状态:0执行中 1执行失败 2执行成功
  int? sizeId;
  int? styleId;
  int? likeNum; //点赞数
  int? isLike; //是否点赞：0否 1是

  GalleryCreateModel({
    this.id,
    this.title,
    this.content,
    this.url,
    this.taskId,
    this.progress,
    this.taskStatus,
    this.sizeId,
    this.styleId,
    this.likeNum,
    this.isLike,
  });

  factory GalleryCreateModel.fromJson(Map<String, dynamic> json) => GalleryCreateModel(
    id: json["id"],
    title: json["title"],
    content: json["content"],
    url: json["url"],
    taskId: json["taskId"],
    progress: json["progress"],
    taskStatus: json["taskStatus"],
    sizeId: json["sizeId"],
    styleId: json["styleId"],
    likeNum: json["likeNum"],
    isLike: json["isLike"],
  );

  Map<String, dynamic> toJson() => {
    "id": id,
    "title": title,
    "content": content,
    "url": url,
    "taskId": taskId,
    "progress": progress,
    "taskStatus": taskStatus,
    "sizeId": sizeId,
    "styleId": styleId,
    "likeNum": likeNum,
    "isLike": isLike,
  };
}
